<?php
class ControllerPaymentCod extends Controller {
	protected function index()
    {
		$this->data['continue'] = $this->url->link('checkout/success');

        $this->load->helper('html');

        $this->data['button_confirm']=getAjaxButton(array(
            'button_text'=>$this->language->get('button_confirm'),
            'div_class'=>'button',
            'span_id'=>'button-confirm',
            'span_class'=>'button',
        ));

        $this->data['loading_image']=getLoadingImage(array('
            img_src'=>HTTP_IMAGE.'data/loadingIcon.gif',
            'div_id'=>'search-loading',
            'div_class'=>'loading',
            'img_id'=>'loading',
        ));

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/cod.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/payment/cod.tpl';
		} else {
			$this->template = 'default/template/payment/cod.tpl';
		}	
		
		$this->render();
	}
	
	public function confirm() {

		$this->load->model('checkout/order');
		$this->model_checkout_order->confirm($this->session->data['order_id'], $this->config->get('cod_order_status_id'));
	}
}
?>